package com.guguskins.back.controller;


import com.guguskins.back.entity.vo.ResultVo;
import com.guguskins.back.service.GuBotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-08-02
 */
@RestController
@RequestMapping("/bot")
public class GuBotController {

    @Autowired
    private GuBotService botService;

    @GetMapping("/back/list")
    public ResultVo backList() {
        return ResultVo.success(botService.list());
    }

    @PostMapping("/back/update")
    public ResultVo backUpdate() {
        if (botService.backUpdate()) {
            return ResultVo.success("更新成功");
        }
        return ResultVo.fail("更新失败");
    }

}
